package com.itheima.Service.CheckServicelmpl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.itheima.Service.OrderService;
import com.itheima.common.entity.PageResult;
import com.itheima.common.entity.QueryPageBean;
import com.itheima.mapper.OrderMapper;
import com.itheima.pojo.OrderTO;
import com.itheima.pojo.Orderdev;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class OrderServicelmpl implements OrderService {
    @Autowired
    private OrderMapper orderMapper;
    /**
     * 查询预约列表
     * @param queryPageBean
     * @return
     */
    public PageResult listpage(QueryPageBean queryPageBean) {
        PageHelper.startPage(queryPageBean.getCurrentPage(),queryPageBean.getPageSize());
        Orderdev orderdev = new Orderdev();
        orderdev.setName(queryPageBean.getQueryString());
        Page<Orderdev> arr =orderMapper.listpage(orderdev);
        return new PageResult(arr.getTotal(),arr.getResult());
    }

    /**
     * 修改状态
     * @param orderTO
     */
    public void updatestatus(OrderTO orderTO) {
        orderMapper.update(orderTO);
    }
}
